import numpy as np

#加载embedding字典
all_index2vec_dict = np.load('/mnt/gru/readFile/all_index2vec_dict.pkl', allow_pickle=True)
#txt文本文件路径
txt_path = '/data/train/image_text/050960.txt'
#读取文本内容，以逗号为间隔，保存到变量s中
with open(txt_path, 'r') as f:
    s = [i[:-1].split(',') for i in f.readlines()]
#遍历文本中数字内容，提取字典中相应embedding特征向量
for i in s[0]:
    print(all_index2vec_dict[int(i)])

    
    
    
    
    
    